Skip to content

Generate supplemental RPM packages - #1147

Open
cpuguy83 wants to merge 1 commit into
subpackage-modelfrom
subpackage-rpm
Open

Generate supplemental RPM packages#1147
cpuguy83 wants to merge 1 commit into
subpackage-modelfrom
subpackage-rpm

Conversation

@cpuguy83

Copy link
Copy Markdown
Collaborator

Adds RPM subpackage sections, artifact selection, and scriptlets, with template and LLB-level coverage.

This is layer 2 of the native supplemental-packages stack and depends on #1146.

Related to #607.

@cpuguy83
cpuguy83 marked this pull request as ready for review July 16, 2026 21:45
Copilot AI review requested due to automatic review settings July 16, 2026 21:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds RPM generation for target-level supplemental packages sharing the primary build output.

Changes:

  • Generates RPM subpackage metadata, artifacts, dependencies, and scriptlets.
  • Refactors shared artifact installation and scriptlet generation.
  • Adds template and LLB-level tests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
packaging/linux/rpm/template.go Generates supplemental RPM sections and artifacts.
packaging/linux/rpm/template_test.go Tests generated subpackage specifications.
packaging/linux/rpm/buildroot_test.go Tests generated RPM-spec LLB operations.

Comment thread packaging/linux/rpm/template.go
Comment thread packaging/linux/rpm/template.go
Comment thread packaging/linux/rpm/template.go
Comment thread packaging/linux/rpm/template.go
Comment thread packaging/linux/rpm/template.go
Comment thread packaging/linux/rpm/template.go Outdated
Comment thread packaging/linux/rpm/template.go
@cpuguy83
cpuguy83 force-pushed the subpackage-rpm branch 3 times, most recently from 117864c to 5f87907 Compare July 17, 2026 19:13

@invidian invidian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments, but LGTM overall. I did not analyze test coverage in depth, I assume it's sufficient.

Comment thread test/subpackage_test.go Outdated
Comment thread test/subpackage_test.go Outdated
Comment thread test/subpackage_test.go Outdated
Comment thread packaging/linux/rpm/buildroot_test.go Outdated
Comment thread packaging/linux/rpm/buildroot_test.go Outdated
Comment thread packaging/linux/rpm/buildroot_test.go Outdated
Comment thread packaging/linux/rpm/buildroot_test.go Outdated
{{ .PreUn -}}
{{ .PostUn -}}
{{ .Files -}}
{{ .SubPackages -}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this amount of string builder code, have we tried leveraging templates more instead of string builder? Maybe it would make things more readable? Right now all this code here is rather hard to follow tbh.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its something we could take a look at.
Templates have their own trade-off/readability issues, though.

@cpuguy83
cpuguy83 force-pushed the subpackage-model branch 2 times, most recently from 6d192e0 to a20af72 Compare July 20, 2026 17:55
@cpuguy83
cpuguy83 force-pushed the subpackage-rpm branch 2 times, most recently from 5d94f50 to 5de2413 Compare July 20, 2026 22:33
Add SubPackages() method and supporting types to produce %package,
%description, %files, and scriptlet sections for each supplemental
package. Refactor Install() to include subpackage artifacts in the
shared %install section. Includes comprehensive template-level tests.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants